// =================================================================================================
//
//	CopyEngine Framework
//	Copyright 2012 Eran. All Rights Reserved.
//
//	This program is free software. You can redistribute and/or modify it
//	in accordance with the terms of the accompanying license agreement.
//
// =================================================================================================

package gui.utils
{
    import flash.display.MovieClip;

    public class MessageBox
    {
        private static var _instance:MessageBox;

        public static function get instance():MessageBox
        {
            if (_instance == null)
            {
                _instance = new MessageBox();
            }
            return _instance;
        }

        private var MessageMcClass:Class;
        private var mGUIMc:MovieClip;


        public function MessageBox()
        {
        }

        public function initialize(_MessageMcClass:Class, _guiMc:MovieClip):void
        {
            MessageMcClass = _MessageMcClass;
            mGUIMc = _guiMc;
        }

        public function showMsg(_msg:String):void
        {
            var currentMsgMc:MovieClip = new MessageMcClass() as MovieClip;
            currentMsgMc["mc"]["msgTF"].text = _msg;
            currentMsgMc.x = mGUIMc.width / 2;
            currentMsgMc.y = 50;
            mGUIMc.addChild(currentMsgMc);
        }

    }
}
